<script>
//    var router_url = "<?php echo Router::url(array('controller'=>'','action'=>''));?>";
//    
//    function routerUrl(controller, action, parameters)
//    {
//        full_url = "http://localhost"+router_url+"/"+controller+"/"+action+"/"+parameters;
//        return full_url;
//    }
//    
//    function abrePagina(url)
//    {
//        $.ajax({
//            cache: false,
//            type: 'GET',
//            dataType: 'HTML', 
//            url: url,
//            data: { name: "John", location: "Boston" }
//            }).done(function( msg ) {
//                $('.alvo').html(msg);
//        });
//    }
//
//    $(document).ready(function(){
//        abrePagina(routerUrl('pages','edit',1));
//    });

</script>

<section id="typography">
  <div class="page-header">
    <h1>Gerenciador <small>páginas, fotos, vídeos, agenda e o conteúdo que precisar</small></h1>
  </div>
    
    <?php echo $this->element('_admin/management_menu'); ?>

  <!-- Headings & Paragraph Copy -->
    <div class="row">
        <?php echo $this->element('_admin/events/management_side'); ?>

        <div class="span8">
            <h3><?=$this->data['Event']['title'];?></h3>
            <?php echo $this->element('_admin/flash_messages'); ?>
            
            <div class="alvo">
            <? echo $this->Form->create('Event', array('class'=>'well')); ?>
                <? echo($this->Form->input('Event.id')); ?>
                <? echo $this->Form->input('Event.title', array('label'=>'Título'));?>
                <? echo $this->Form->input('Event.where', array('label'=>'Local'));?>
                
                <? echo $this->Form->input('Event.date', array('label'=>'Data', 'type'=>'text', 'class'=>'dataBrasil'));?>
                <? echo $this->Form->input('Event.time', array('label'=>'Hora', 'type'=>'text', 'class'=>'hora'));?>
                <? echo $this->Tinymce->input('Event.description', array('label' => 'Descrição'),array('language'=>'en' ), 'bbcode'); ?>
                <br/>
                <label>Status</label>
                <div class="make-switch" data-on="success" data-off="default">
                    <? echo $this->Form->checkbox('Event.type', array('hiddenField' => false)); ?>
                </div>
                    
                <p class="help-block"><br/>
                    <button type="submit" class="btn btn-success">Salvar</button>
                    <button type="submit" class="btn btn-danger">Deletar</button>
                </p>
            <? echo $this->Form->end(); ?>
            </div>
        </div>
    </div>
</section>